Repository navigation
Let DockerSandbox keep vendor in a volume for listed folders - #340
Merged
Merged
Conversation
DockerSandbox puts vendor in a volume for each folder composer installs into. Later runs in that folder mount it read-only, and cleanup() removes the volumes when the verify or run finishes. Workshop images need /solution/vendor, like /composer, so the volume is writable.
The caller lists which folders keep vendor in which volume, so it can stay between verifies. Drops the random volumes and Sandbox::cleanup().
This was referenced Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fourth task of #336 (student packages), reworked.
DockerSandboxconstructor argumentvendorVolumes: folder => volume, eg.['/tmp/php-school/<student id>' => 'php-school-vendor-<student id>-<workshop>-<exercise>']. Runs in a listed folder, or below it, mount the volume at/solution/vendor: read-write for composer, read-only otherwise.vendor/in the folder as before./solution/vendorcreated with 1777, or the volume is root-owned (already in learn-you-php#117 and php8-appreciate#49).phpschool.io passes the student's volume and skips
composer updatewhen the packages haven't changed. Tested with real Docker: second verify of dependency-heaven uploads in 0.6s instead of 2.7s, and deleting the volume just means the next verify reinstalls from the saved lock.For task 5:
ComposerCheckchecksvendor/exists on the host, which passes only because Docker creates the mount point in the bind-mounted folder.